<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%--头部内容开始--%>
<jsp:include page="head.jsp"/>
<%--头部内容结束--%>
<%--中间内容开始--%>

<div class="layui-container fly-marginTop fly-user-main">
    <jsp:include page="manger_left.jsp"/>
    <div class="fly-panel fly-panel-user" pad20>

        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title" id="LAY_mine">
                <li data-type="mine-jie" lay-id="index" class="layui-this">修改博客信息</li>
            </ul>
            <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 10px 0;">
                <div class="layui-tab-item layui-show">
                    <form:form action="${pageContext.request.contextPath}/blog/student/updateblog.do" method="post">
                        <div class="layui-row layui-col-space15 layui-form-item">
                            <div class="layui-col-md4">
                                <label class="layui-form-label">选择分类</label>
                                <div class="layui-input-block">
                                    <select lay-verify="required" name="tId" >
                                        <%--<option value="${blog.tId}" selected="selected">${blog.type.tName}</option>--%>
                                        <c:forEach items="${typelist}" var="typelist">
                                            <c:if test="${typelist.tId == blog.tId}">
                                                <option value="${typelist.tId}" selected="selected">${typelist.tName}</option>
                                            </c:if>
                                            <c:if test="${blog.tId != typelist.tId}">
                                                <option value="${typelist.tId}">${typelist.tName}</option>
                                            </c:if>
                                        </c:forEach>

                                    </select>
                                </div>
                            </div>
                            <div class="layui-col-md7">
                                <label for="L_title" class="layui-form-label">标题</label>
                                <div class="layui-input-block">
                                    <input type="hidden" name="bId" value="${blog.bId}">
                                    <input type="text" id="L_title" name="bTitle" value="${blog.bTitle}" required lay-verify="required" autocomplete="off" class="layui-input">

                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item layui-form-text">
                            <!--百度富文本编辑器-->
                            <textarea  id="bContent" name="bContent"  style="width:100%;height:500px;">
                                ${blog.bContent}
                            </textarea>

                        </div>
                        <div class="layui-form-item">
                            <button class="layui-btn" type="submit" lay-filter="*" lay-submit>立即修改</button>
                        </div>
                    </form:form>
                </div>
            </div>
        </div>
    </div>
</div>
<%--中间内容结束--%>
<%--底部内容开始--%>
<jsp:include page="bottom.jsp"/>
<!-- UEditor 编辑器实例化 -->
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('bContent', {topOffset:61});//编辑器浮动时，距离顶部80px
</script>
